#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    connect(timer,&QTimer::timeout,this,[this]()
    {
       int val = ui->progressBar->value();
       if(val >= 100)
       {
           timer->stop();
           return;
       }
       ui->progressBar->setValue(val+1);
    });
    //启动定时器
    timer->start(10);
}

Widget::~Widget()
{
    delete ui;
}

